<template>
    <el-form-item>
        <el-select v-model="dateModel" style="width: 105px;" clearable filterable :placeholder="placeholder"
            @change="dateChange()">
            <el-option v-for="i in dict" :key="i.value" v-if="i.value < min && i.value <= max" :label="i.label"
                :value="i.value">
            </el-option>
        </el-select>
    </el-form-item>
</template>

<script>
export default {
    name: 'SDict',
    props: {
        name: "",
        min: {
            type: Number,
            default: 0
        },
        max: {
            type: Number,
            default: 10000
        },
    },
    data() {
        return {
            dateModel: "",
            placeholder: ""
        }
    },
    methods: {
        dateChange: function () {
            this.$emit('input', this.dateModel)


        }
    },
    created() {
        var d = this.$store.state.dict;
        this.placeholder = d.dictName[this.name]
        this.dict = d.dicts[this.name];
    }
}
</script>
